// 特权相关
import {
	request
} from "../utils/request"



export default {
	// 刷新二维码
	privilegeQrCode: (userPrivilegeId) => {
		return request({
			url: `/amianfrontend/privilege/qrCode/${userPrivilegeId}`
		})
	},

	// 购买/兑换特权
	// --1.创建特权订单
	privilegeCreate: (privilegeId, consumeType) => {
		return request({
			url: `/amianfrontend/privilege/create/${privilegeId}?consumeType=${consumeType}`
		})
	},

	// --2.通过支付单号进行支付
	privilegePay: (payNo) => {
		return request({
			url: `/amianfrontend/privilege/pay/${payNo}`
		})
	},

	// --3.通过支付单号进行支付状态查询
	privilegeQuery: (payNo) => {
		return request({
			url: `/amianfrontend/privilege/query/${payNo}`
		})
	},

	// 我的特权列表
	privilegeOwnerList: (pageSize, pageNum) => {
		return request({
			url: `/amianfrontend/privilege/owner/list?pageSize=${pageSize}&pageNum=${pageNum}`
		})
	},
	// 
	// 特权详情
	privilege: (privilegeId) => {
		return request({
			url: `/amianfrontend/privilege/${privilegeId}`
		})
	},

	// 获取特权列表名对应的列表
	privilegeList: (data) => {
		return request({
			url: `/amianfrontend/privilege/list`,
			data
		})
	},

	// 获取特权列表名
	privilegeCategoryList: () => {
		return request({
			url: `/amianfrontend/privilege/categoryList`
		})
	}

}
